package com.maimang.platform.crm.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.maimang.platform.annotation.Excel;
import com.maimang.platform.base.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;


/**
 * @author Rocky
 * @version 1.0.0
 * @classname CrmWorkRecord
 * @description <br>工作记录表对应实体类</br>
 * @date 2019-10-07 09:43:10
 * @email jintaozhao@qq.com
 */
@Table(name = "crm_work_record")
public class CrmWorkRecord extends BaseEntity {
	private static final long serialVersionUID = 1L;
	/**
	 * 移动端专用token
	 */
	@Transient
	private String key;
	/**
	 * 部门id，用于检索
	 */
	@Transient
	private Long deptId;
	/**
	 * 工作记录id
	 */
	@Excel(name = "工作记录id")
	@Id
	@GeneratedValue(generator = "JDBC")
	@Column(name = "work_id")
	private Integer workId;
	/**
	 * 员工姓名
	 */
	@Excel(name = "员工姓名")
	@Column(name = "user_name")
	private String userName;
	/**
	 * 员工id
	 */
	@Column(name = "user_id")
	private Long userId;
	/**
	 * 员工工号
	 */
	@Excel(name = "员工工号")
	@Column(name = "job_number")
	private String jobNumber;
	/**
	 * 客户id
	 */
	@Excel(name = "客户id")
	@Column(name = "customer_id")
	private Integer customerId;
	/**
	 * 客户名称
	 */
	@Excel(name = "客户名称")
	@Column(name = "customer_name")
	private String customerName;
	/**
	 * 是否新客户(0老 1新)
	 */
	@Excel(name = "是否新客户")
	@Column(name = "is_new")
	private String isNew;
	/**
	 * 工作类型(电话0、拜访1、提案2、签约3)
	 */
	@Excel(name = "工作类型(电话0、拜访1、提案2、签约3)")
	@Column(name = "work_type")
	private Integer workType;
	/**
	 * 工作开始时间
	 */
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@Excel(name = "工作时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "start_time")
	private Date startTime;
	/**
	 * 工作结束时间
	 */
	// @Excel(name = "工作结束时间", dateFormat = "yyyy-MM-dd HH:mm:ss")
	@Column(name = "end_time")
	private Date endTime;
	/**
	 * 事项
	 */
	@Excel(name = "事项")
	@Column(name = "item")
	private String item;
	/**
	 * 备注
	 */
	@Excel(name = "备注")
	@Column(name = "remark")
	private String remark;
	/**
	 * 精度
	 */
	private Integer accuracy;
	/**
	 * 经度
	 */
	private String longitude;
	/**
	 * 纬度
	 */
	private String latitude;
	/**
	 * 省
	 */
	private String province;
	/**
	 * 市
	 */
	private String city;
	/**
	 * 地址
	 */
	@Excel(name = "地址")
	@Column(name = "address")
	private String address;

	public Long getDeptId() {
		return deptId;
	}

	public void setDeptId(Long deptId) {
		this.deptId = deptId;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public Integer getWorkId() {
		return workId;
	}

	public void setWorkId(Integer workId) {
		this.workId = workId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getJobNumber() {
		return jobNumber;
	}

	public void setJobNumber(String jobNumber) {
		this.jobNumber = jobNumber;
	}

	public Integer getCustomerId() {
		return customerId;
	}

	public void setCustomerId(Integer customerId) {
		this.customerId = customerId;
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}

	public String getIsNew() {
		return isNew;
	}

	public void setIsNew(String isNew) {
		this.isNew = isNew;
	}

	public Integer getWorkType() {
		return workType;
	}

	public void setWorkType(Integer workType) {
		this.workType = workType;
	}

	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}

	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}

	public String getItem() {
		return item;
	}

	public void setItem(String item) {
		this.item = item;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Integer getAccuracy() {
		return accuracy;
	}

	public void setAccuracy(Integer accuracy) {
		this.accuracy = accuracy;
	}

	public String getLongitude() {
		return longitude;
	}

	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}

	public String getLatitude() {
		return latitude;
	}

	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String toString() {
		return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
				.append("workId", getWorkId())
				.append("userName", getUserName())
				.append("userId", getUserId())
				.append("jobNumber", getJobNumber())
				.append("customerId", getCustomerId())
				.append("customerName", getCustomerName())
				.append("isNew", getIsNew())
				.append("workType", getWorkType())
				.append("startTime", getStartTime())
				.append("endTime", getEndTime())
				.append("item", getItem())
				.append("remark", getRemark())
				.append("accuracy", getAccuracy())
				.append("longitude", getLongitude())
				.append("latitude", getLatitude())
				.append("province", getProvince())
				.append("city", getCity())
				.append("address", getAddress())
				.append("createUser", getCreateUser())
				.append("createTime", getCreateTime())
				.append("updateUser", getUpdateUser())
				.append("updateTime", getUpdateTime())
				.toString();
	}
}
